package com.github.m6d21.sso.service.permission;

import com.github.m6d21.sso.model.permission.entity.Permission;
import com.github.m6d21.sso.model.permission.qo.PermissionQO;
import com.github.pagehelper.PageInfo;
import java.util.List;
import javax.validation.constraints.NotNull;

/**
 *<p>
 *
 *</p>
 *
 * @author liuyang
 * @date 2019/1/4 Fri 17:19:00
 * @since 1.0.0
 */
public interface IPermissionService {

    List<Permission> query(PermissionQO permissionQO);

    PageInfo<Permission> queryByPage(Integer pageNo, Integer pageSize, PermissionQO permissionQO);

    PageInfo<Permission> queryByPageForAdmin(Integer pageNo, Integer pageSize, PermissionQO permissionQO);

    Permission savePermission(Permission permission);

    Permission modifyPermissionById(Permission permission);

    Boolean deletePermissionById(@NotNull(message = "权限id不能为空") Integer id);

    Boolean deletePermissionByIds(@NotNull(message = "权限ids不能为空") List<Integer> ids);

    Boolean existByPermissionCode(@NotNull(message = "权限Code不能为空") String  permissionCode);
}
